#pragma once
#include <string>
#include "InterestTable.h"

using namespace std;
class Person
{
private:
	string name;
	bool female;
	
public:
	InterestTable interests;

	Person(void)
	{
		this->name = "";
		this->female = false;
	}

	Person( string name, bool female, InterestTable interests )
	{
		this->name = name;
		this->female = female;
		this->interests = interests;
	}

	~Person(void)
	{
	}

	friend bool operator<( Person &lop, Person &hop )
	{
		if( lop.name < hop.name )
			return true;
		return false;
	}

	friend bool operator==( Person &lop, Person &hop )
	{
		if( lop.name == lop.name )
			return true;
		return false;
	}

	friend ostream &operator<<( ostream &out, Person &p )
	{
		out << "(";
		if( p.GetFemale() )
			out << "Female,";
		else
			out << "Male,";
		out << p.GetName() << ",";
		out << p.interests;
		out << ")" << endl;
		return out;
	}

	friend istream &operator>>( istream &in, Person &p )
	{
		string dummyStr;
		char dummyChar;

		in >> dummyChar; // skip '('
		getline(in, dummyStr, ',');
		if( dummyStr == "Female" )
			p.female = true;
		else
			p.female = false;
		getline(in, p.name, ',');
		in >> p.interests;

		return in;
	}


	string GetName() { return this->name; }
	bool GetFemale() { return this->female; }

	void SetName( string name ) { this->name = name; }
	void SetFemale( bool female ) { this->female = female; }
};

